package com.zzy.oss.controller;

import com.zzy.oss.service.OssService;
import com.zzy.utils.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.UnsupportedEncodingException;
import java.util.Map;

/**
 * @Author kazu
 * @Date 2023/2/4 20:44
 * @Version 1.0
 */
@SuppressWarnings({"all"})
@RestController
@RequestMapping("/oss/oss")
public class OssController {
	
	@Autowired
	private OssService ossService;
	
	/**
	 * 用户获取签名，直传文件
	 */
	@GetMapping("/policy")
	public R uploadFileToOss() throws UnsupportedEncodingException {
//		String url = ossService.uploadFile(file);
		Map<String, Object> map = ossService.uploadFile();
		return R.ok().put("data", map);
	}
	
	
}












